﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace BLL
{
  public  interface IBizSQL
    {
        DataTable GetOneInfo(string tableName, string[] primaryKey);
        DataTable GetList(string tableName, string filter);
        bool ExecSQL(string strSQL);
        DataSet ExecSQL2(string strSQL);


        string Delete(string tableName, string[] primaryKey);//删除一行
        string Delete(string tableName, string[] primaryKey, ArrayList arrayList);
        //插入一行
        bool Insert(string tableName, object PageOrUserControl);//自动获取界面数据
        bool Insert(string tableName, SortedDictionary<string, string> sdList);//手工获取界面数据
        bool Insert(string tableName, object PageOrUserControl, ArrayList arrayList); //自动获取+其它SQL
        bool Insert(string tableName, SortedDictionary<string, string> sdList, ArrayList arrayList);//手工获取+其它SQL
        //更新一行
        bool Update(string tableName, object PageOrUserControl);//自动获取界面数据
        bool Update(string tableName, SortedDictionary<string, string> sdList);//手工获取界面数据
        bool Update(string tableName, object PageOrUserControl, ArrayList arrayList);
        bool Update(string tableName, SortedDictionary<string, string> sdList, ArrayList arrayList);
        //插入多表的数据
        string InsertMultiTable(List<String[,]> detailList);

        //后三个方法是同时对主表和明细表操作
        string InsertMainAndDetail(string mainTable, SortedDictionary<string, string> mainList, string detailTable, List<SortedDictionary<string, string>> detailList);
        string UpdateMainAndDetail(string mainTable, SortedDictionary<string, string> mainList, string[] primaryKey, string detailTable, List<SortedDictionary<string, string>> detailList);
        string InsertMainAndDetail(string mainTable, List<String[]> mainList, string detailTable, string fCode, List<String[]> detailList);

        SortedDictionary<string, string> GetCtlValue(object PageOrUserControl);
       
    }
}
